<?php

/**
 * @author christian
 * @copyright 2011
 * @abstract carga de todo el itinerario que es parte de un tour del itenario del tour
 */
 


$ruta=$_SERVER['DOCUMENT_ROOT']."/viventura"."/MDTour";
include_once("$ruta/conf/CConfig.php");
include_once("$ruta/elements/head.tpl");
include_once("$ruta/MDTourGeneral/CTourTableDraw.php");
include_once("$ruta/MDTourGeneral/CDrawPageReg.php");
include_once("$ruta/star.php");
include_once("$ruta/view/CDrawMenuTour.php");



if (!isset($_GET['idOpe'])) {$_GET['idOpe'] = "NULL"; }
if (!isset($_GET['nval'])) {$_GET['nval'] = "NULL"; }
$idOpe=$_GET['idOpe'];
$nval=base64_decode($_GET['nval']);

$titOpe="";$filter="";
if($idOpe!="NULL"){
    $titOpe = " del Operador <em>$nval</em> ($idOpe)";
    $filter = "where OFICINAS_idOfi IN (Select idOfi from oficinas where OPERADOR_idOpe=$idOpe)";

}


$items=array("Nuevo Tour"=>"CSmallDefinePack.php","Ver paquetes"=>"/viventura/MDTour","Extensiones"=>"/viventura/MDTour/MDExtensiones");

CDrawMenuTour::getInstance()->setMenu($items);
CDrawMenuTour::getInstance()->DrawDivAdBegin("content_area_user_title","1");echo "<h1>Tours".$titOpe."</h1>";
CDrawMenuTour::getInstance()->rigth_side_begin();//empieza lado derecho 



$title="Tour";
$maintable="tour"; 
$growtable="pack_has_tour";


if (!isset($_POST['updated'])) {$_POST['updated'] = "NULL"; }
if (!isset($_GET['default'])) {$_GET['default'] = "0"; }

$default = $_GET['default'];
$updated = $_POST['updated'];


if($updated!="NULL"){echo "El paquete $updated fue actualizado";}
else{echo "";}

if($default==1){
    echo "<h2></br>A continuación se están listando los Default Tour, sirven a manera de plantilla para la creación de nuevos tours </h2>";
}

$columnas=array("idPackTour"=>"PackTour","PACK_idPack"=>"Paquete","OriTour"=>"Origen","DestTour"=>"Destino","DateBegTour"=>"Inicio","DateEndTour"=>"Final","MinPaxTour"=>"Mínimo","MaxPaxTour"=>"Máximo");
//CTourTableDraw::getInstance()->DrawTable($title,$maintable,$columnas);
CTourTableDraw::getInstance()->DrawTable("",$maintable,$growtable,$columnas,$default);

?>
<p align="right">
<?php
  
  



CDrawMenuTour::getInstance()->rigth_side_end();

    if($default==1){
        CDrawPageReg::getInstance()->DrawButton("Ver tours","index.php");
        }
    else{
        CDrawPageReg::getInstance()->DrawButton("Ver default tours","index.php?default=1");}

        CDrawPageReg::getInstance()->DrawButton("Bloqueos","../MDBlockTour/index.php?default=1");

   
CDrawMenuTour::getInstance()->DrawDivAdEnd();
  
  
  
   ?>
</p> 
<?php   
?>